//
// Created by francklinson on 2021/10/23 AT 19:49.
//
#include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <algorithm>
#include <functional>
#include <climits>
#include <string>
#include "../myTool.h"

// 单例
// single instance ——>singleton
// 命名空间干净
class Random {
public:
    Random(const Random &) = delete; // 不准复制
    static Random &Get() {
        static Random instance;
        return instance;
    }

    static float Float() { return Get().IFloat(); } // 对外接口 调用私有函数


private:
    Random() {}

    float IFloat() { return m_RandomGenerator; }

    float m_RandomGenerator = 0.5f;
    static Random s_Instance;  // 在类的内部构建一个本类的唯一实例
};


int main() {
    Random &instance = Random::Get();
    float num = Random::Float();

    return 0;
}

